package com.woniu.service.command;

import com.woniu.outlet.elasticSearch.po.Fund;
import com.woniu.util.ApplicationContextHolder;
import lombok.Data;

import java.util.List;

/**
 * @description:
 * @author: my
 * @time: 2021/5/6 10:55
 */
@Data
public class SearchFundCommand {
    private SearchFundCommandHandler handler;
    private String name;

    public SearchFundCommand(){
        this.handler =
                ApplicationContextHolder.getApplicationContext().getBean(SearchFundCommandHandler.class);
    }

    public SearchFundCommand(String name){
        this();
        this.name = name;
    }

    public List<Fund> execute(){
        return this.handler.action(this);
    }
}
